import Vue from 'vue'
import Vuex from 'vuex'

import createPersistedState from 'vuex-persistedstate'
//需要使用插件一次
Vue.use(Vuex)
//引入小仓库
// import home from './modules/home'
import menu from './modules/menu'
import tab from './modules/tab'
import layout from './modules/layout'
export default new Vuex.Store({
  modules: {
    menu,
    tab,
    layout
  },
  plugins: [
    createPersistedState({
      storage: window.localStorage,
      // 只持久化这些路径下的状态
      paths: ['tab.tabList', 'layout.isCollapse']
    })
  ]
})
